package service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import service.StuManager;
import dao.UserDao;
import domain.User;
@Service("sm")
public class StuManagerImpl implements StuManager {
	@Autowired(required=true)
	private UserDao ud;//要依赖接口IoC思想
	
	/*public void setUd(UserDao ud) {
		this.ud = ud;
	}
	
	public UserDao getUd() {
		return ud;
	}*/


	@Override
	public User login(String xh, String psd) {
		
		return ud.findStu(xh, psd);
	}

	@Override
	public int regist(User u) {
		//u.setPsd(BaseUtil.JohnMd(u.getPsd(), "md5"));
		return ud.addUser(u);
	}

}
